Skip to content

Feature/133 100 code coverage#134

Merged
stiwicourage merged 2 commits into
developfrom
feature/133-100-code-coverage
Apr 28, 2026
Merged

Feature/133 100 code coverage#134
stiwicourage merged 2 commits into
developfrom
feature/133-100-code-coverage

Conversation

@stiwicourage

Copy link
Copy Markdown
Owner

Summary

  • Expanded coverage-focused tests across CI coverage helpers, release internals, package helpers, and update-notification flows.
  • Fixed runtime test support availability issues so run.ps1 no longer fails with missing helper functions during Pester execution.
  • Fixed Initialize-NovaPackageOutputDirectory so an empty PackageMetadataList raises the intended structured validation error instead of an IndexOutOfRangeException.
  • Extended Invoke-NovaPowerShellScriptWithTimeout test coverage through shared runner support helpers and validated success, timeout, and failure-disposal behavior.
  • Why this change was needed: the current coverage work introduced or depended on new test helpers, but some were not available at runtime under full run.ps1 execution. That caused the full Pester run to fail even though the intended behaviors were valid. This change aligns the tests with the real runtime environment and restores a green build/test workflow.
  • Follow-up work: continue the remaining coverage batches from plan.md.

Affected area

  • nova CLI or command routing
  • Public PowerShell cmdlet behavior
  • Scaffolding or project.json handling
  • Build, test, analyzer, coverage, or CI helper flow
  • Package, raw upload, or package metadata workflow
  • Publish, release, semantic-release, or GitHub Actions automation
  • Self-update or notification preference behavior
  • Contributor documentation (README.md, CONTRIBUTING.md, repository workflow docs)
  • End-user docs (docs/*.html)
  • Command help (docs/NovaModuleTools/en-US/*.md)
  • src/resources/example/
  • Dependency or manifest changes (package.json, workflow dependencies, release tooling)
  • Security-sensitive change
  • Documentation-only change
  • Other

Review guidance

  • Start with the runtime test support fixes in tests/CiCoverage.Tests.ps1 and tests/UpdateNotification.TestSupport.ps1, because those unblock the full run.ps1 Pester workflow.
  • Then review the production fix in src/private/package/InitializeNovaPackageOutputDirectory.ps1, which now safely handles an empty package metadata list before accessing the first item.
  • Main changed files/folders:
    • tests/CiCoverage.Tests.ps1
    • tests/RemainingHelperCoverage.Tests.ps1
    • tests/CoverageGaps.ReleaseInternals.Tests.ps1
    • tests/UpdateNotification.TestSupport.ps1
    • tests/UpdateNotification.Tests.ps1
    • src/private/package/InitializeNovaPackageOutputDirectory.ps1
    • src/private/update/InvokeNovaPowerShellScriptWithTimeout.ps1
  • Trade-offs / follow-up:
    • This summary reflects the currently completed coverage work in the workspace, not all remaining items from plan.md.
    • No user-facing docs were changed because the work is internal test/coverage and helper validation focused.

Validation

  • Invoke-NovaBuild
  • Test-NovaBuild
  • ./scripts/build/Invoke-ScriptAnalyzerCI.ps1
  • ./scripts/build/ci/Invoke-NovaModuleToolsCI.ps1
  • Targeted Nova workflow validated (% nova build, % nova test, % nova merge, % nova deploy,
    % nova publish,
    % nova release, % nova update, % nova notification, or % nova init as relevant)
  • Docs/example only; executable validation not needed

Validation notes:

Focused validation:
- Invoke-NovaBuild
- Invoke-Pester ./tests/CiCoverage.Tests.ps1,./tests/RemainingHelperCoverage.Tests.ps1,./tests/UpdateNotification.Tests.ps1 -Output Detailed
- Result: Tests Passed: 123, Failed: 0

Full workflow validation:
- pwsh -NoLogo -NoProfile -File ./run.ps1
- Result: Tests Passed: 609, Failed: 0

Additional checks:
- PSScriptAnalyzer: no findings (via run.ps1)
- git --no-pager diff --check
- Result: clean
- CodeScene pre-commit safeguard
- Result: quality_gates = passed

The dedicated CI wrapper script ./scripts/build/ci/Invoke-NovaModuleToolsCI.ps1 was not run separately in this session.
Nova command flows were validated through Pester coverage and the full run pipeline rather than manual standalone CLI invocations.

Documentation and release follow-up

  • README.md reviewed and updated if contributor workflow, architecture, CI, release, or automation changed
  • CONTRIBUTING.md reviewed and updated if contribution expectations or review guidance changed
  • CHANGELOG.md reviewed and updated if the change matters to users, maintainers, or contributors
  • docs/NovaModuleTools/en-US/ help updated if a public command or CLI behavior changed
  • docs/*.html updated if end-user workflows or examples changed
  • src/resources/example/ reviewed and updated if the real-world project layout, package model, or upload workflow
    changed
  • No documentation, changelog, or example updates were needed

Maintainability, compatibility, and risk

  • Code Health / maintainability impact considered
  • No breaking change
  • Breaking change
  • Security-sensitive change
  • CI, workflow, or release-pipeline impact
  • Dependency-review impact

Risk, rollout, or rollback notes:

Compatibility impact is low:
- the only production behavior change is safer handling of an empty PackageMetadataList in Initialize-NovaPackageOutputDirectory
- the rest of the work is test/support coverage and validation hardening

Rollback path:
- revert the touched test files and the Initialize-NovaPackageOutputDirectory change if needed
- rerun ./run.ps1 to confirm the previous baseline

Main risk area:
- test/runtime support publication for helper functions used under full Pester execution
- mitigated by rerunning the affected suites and the full run.ps1 workflow successfully

- Add tests for CodeScene Cobertura remapping helpers
- Implement coverage gap tests for quality helpers
- Validate Nova package output directory initialization
- Improve timeout handling in PowerShell script execution
- Add tests for CodeScene Cobertura remapping helpers
- Implement coverage gap tests for quality helpers
- Validate Nova package output directory initialization
- Improve timeout handling in PowerShell script execution
@stiwicourage stiwicourage linked an issue Apr 28, 2026 that may be closed by this pull request
17 tasks
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@codescene-delta-analysis codescene-delta-analysis Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gates Passed
6 Quality Gates Passed

See analysis details in CodeScene

Absence of Expected Change Pattern

  • NovaModuleTools/tests/UpdateNotification.TestSupport.ps1 is usually changed with: NovaModuleTools/src/private/update/WriteNovaAvailableModuleUpdateWarning.ps1

Quality Gate Profile: Pay Down Tech Debt
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.

@codecov

codecov Bot commented Apr 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@stiwicourage
stiwicourage merged commit 18818fb into develop Apr 28, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

100% code coverage

1 participant